package com.epigeon.amadeo.test2;

import java.util.List;
import java.util.Map;

import android.content.Context;
import android.util.AttributeSet;

import com.epigeon.amadeo.impl.ActiveButton;
import com.epigeon.amadeo.model.Message;
import com.epigeon.amadeo.model.StringMessage;

public class MyActiveButton extends ActiveButton {

	public MyActiveButton(Context context, AttributeSet attr) {
		super(context, attr);
	}
	
	@Override
	public Message compose(List<Message> messageList) {
		String text = null;
		for (Message message : messageList) {
			if ( ListDemo.TAG_FIELD.equals(message.getSourceKey()) ) {
				StringMessage sMessage = (StringMessage) message;
				text = sMessage.getValue();
			}
		} 
		return new StringMessage(MyActiveList.MESSAGE_TYPE_ADD, this.getKey(), text);
	}

	@Override
	public void setParameters(Map<String, String> parameterMap) {
		// nothing to do here		
	}

}
